package com.dinpay.plugin.widget;

import android.app.Dialog;
import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.StateListDrawable;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View.OnClickListener;
import android.view.Window;
import android.view.WindowManager.LayoutParams;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.TextView;
import com.dinpay.plugin.activity.DinpayBaseActivity;
import com.dinpay.plugin.c.a.a;
import com.dinpay.plugin.d.i;

public final class b extends Dialog
{
  public boolean a = true;
  private int b;
  private int c;
  private LinearLayout d;
  private TextView e;
  private LinearLayout f;
  private TextView g;
  private LinearLayout h;
  private Button i;
  private Context j;

  private b(Context paramContext)
  {
    super(paramContext);
    this.j = paramContext;
  }

  public b(Context paramContext, int paramInt)
  {
    this(paramContext);
    this.j = paramContext;
    this.b = paramInt;
    this.c = -2;
  }

  public final void a(CharSequence paramCharSequence, View.OnClickListener paramOnClickListener)
  {
    this.i.setText(paramCharSequence);
    if (paramOnClickListener != null)
      this.i.setOnClickListener(paramOnClickListener);
    this.h.setVisibility(0);
  }

  public final void a(String paramString)
  {
    this.e.setText(paramString);
    this.d.setVisibility(0);
    this.e.setVisibility(0);
  }

  public final void b(String paramString)
  {
    this.g.setText(paramString);
    this.f.setVisibility(0);
    this.g.setVisibility(0);
  }

  public final boolean dispatchKeyEvent(KeyEvent paramKeyEvent)
  {
    return super.dispatchKeyEvent(paramKeyEvent);
  }

  protected final void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    requestWindowFeature(1);
    LinearLayout localLinearLayout = new LinearLayout(this.j);
    localLinearLayout.setLayoutParams(new LinearLayout.LayoutParams(-1, -2));
    localLinearLayout.setOrientation(1);
    this.d = new LinearLayout(this.j);
    LinearLayout.LayoutParams localLayoutParams1 = new LinearLayout.LayoutParams(-1, -2);
    localLayoutParams1.gravity = 17;
    this.d.setLayoutParams(localLayoutParams1);
    this.d.setPadding(10, 10, 10, 10);
    localLinearLayout.addView(this.d);
    LinearLayout.LayoutParams localLayoutParams2 = new LinearLayout.LayoutParams(-1, -2);
    this.e = new TextView(this.j);
    this.e.setGravity(17);
    this.e.setLayoutParams(localLayoutParams2);
    this.e.setTextColor(Color.parseColor("#0c74bd"));
    this.e.setTextSize(24.0F);
    this.d.addView(this.e);
    LinearLayout.LayoutParams localLayoutParams3 = new LinearLayout.LayoutParams(-1, 1);
    TextView localTextView1 = new TextView(this.j);
    localTextView1.setBackgroundColor(Color.parseColor("#0c74bd"));
    localTextView1.setLayoutParams(localLayoutParams3);
    localLinearLayout.addView(localTextView1);
    LinearLayout.LayoutParams localLayoutParams4 = new LinearLayout.LayoutParams(-1, -2);
    this.f = new LinearLayout(this.j);
    this.f.setLayoutParams(localLayoutParams4);
    this.f.setPadding(10, 10, 10, 10);
    localLinearLayout.addView(this.f);
    LinearLayout.LayoutParams localLayoutParams5 = new LinearLayout.LayoutParams(-2, -2);
    localLayoutParams5.gravity = 19;
    this.g = new TextView(this.j);
    this.g.setLayoutParams(localLayoutParams5);
    this.g.setTextColor(Color.parseColor("#333333"));
    this.g.setTextSize(20.0F);
    this.f.addView(this.g);
    LinearLayout.LayoutParams localLayoutParams6 = new LinearLayout.LayoutParams(-1, 1);
    TextView localTextView2 = new TextView(this.j);
    localTextView2.setBackgroundColor(Color.parseColor("#333333"));
    localLayoutParams6.topMargin = 5;
    localTextView2.setLayoutParams(localLayoutParams6);
    localLinearLayout.addView(localTextView2);
    this.h = new LinearLayout(this.j);
    LinearLayout.LayoutParams localLayoutParams7 = new LinearLayout.LayoutParams(-1, -2);
    localLayoutParams7.topMargin = 15;
    this.h.setLayoutParams(localLayoutParams7);
    this.h.setOrientation(0);
    this.h.setGravity(17);
    localLinearLayout.addView(this.h);
    int k = Color.parseColor("#ffffff");
    int m = Color.parseColor("#0c74bd");
    int n = Color.parseColor("#0c74bd");
    StateListDrawable localStateListDrawable = new StateListDrawable();
    Object localObject1;
    Object localObject2;
    if (k == -1)
    {
      localObject1 = null;
      if (m != -1)
        break label812;
      localObject2 = null;
      label536: if (n != -1)
        break label826;
    }
    label812: label826: for (Object localObject3 = null; ; localObject3 = new ColorDrawable(n))
    {
      localStateListDrawable.addState(new int[] { 16842919, 16842910 }, (Drawable)localObject2);
      localStateListDrawable.addState(new int[] { 16842910, 16842908 }, (Drawable)localObject3);
      localStateListDrawable.addState(new int[] { 16842910 }, (Drawable)localObject1);
      localStateListDrawable.addState(new int[] { 16842908 }, (Drawable)localObject3);
      localStateListDrawable.addState(new int[0], (Drawable)localObject1);
      Button localButton = new Button(this.j);
      localButton.setLayoutParams(new LinearLayout.LayoutParams(-1, -2));
      localButton.setBackgroundDrawable(localStateListDrawable);
      localButton.setText("确定");
      localButton.setTextColor(Color.parseColor("#333333"));
      localButton.setTextSize(24.0F);
      this.i = localButton;
      this.h.addView(this.i);
      setContentView(localLinearLayout);
      Drawable localDrawable = i.a(this.j.getResources(), DinpayBaseActivity.class, a.a.d);
      Window localWindow = getWindow();
      WindowManager.LayoutParams localLayoutParams = localWindow.getAttributes();
      if (this.b > 0)
        localLayoutParams.width = this.b;
      if (this.c > 0)
        localLayoutParams.height = this.c;
      localWindow.setBackgroundDrawable(localDrawable);
      localWindow.setAttributes(localLayoutParams);
      this.i.setOnClickListener(new c(this));
      return;
      localObject1 = new ColorDrawable(k);
      break;
      localObject2 = new ColorDrawable(m);
      break label536;
    }
  }

  public final boolean onKeyDown(int paramInt, KeyEvent paramKeyEvent)
  {
    if (!this.a)
      return false;
    return super.onKeyDown(paramInt, paramKeyEvent);
  }

  public final boolean onTouchEvent(MotionEvent paramMotionEvent)
  {
    if (!this.a)
      return false;
    return super.onTouchEvent(paramMotionEvent);
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.dinpay.plugin.widget.b
 * JD-Core Version:    0.6.2
 */